package com.adam.management.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class IndexController {

    private Logger logger = LoggerFactory.getLogger(IndexController.class);

    @RequestMapping(value = "/index",method = RequestMethod.GET)
    public String index(){
        //获取到Authentication对象信息。
        logger.info("=====>>>>>获取到Authentication对象信息=[{}]",SecurityContextHolder.getContext().getAuthentication());
        return "index";
    }
}
